package cn.anc.aonicardv.widget;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.StyleRes;
import cn.anc.aonicardv.R;

/**
 * Created by yangdai on 2017/5/18.
 */

public class ConnectRecorderWifiDialog extends Dialog {

    public ConnectRecorderWifiDialog(@NonNull Context context, @StyleRes int themeResId) {
        super(context, themeResId);
        init(context);
    }

    private void init(final Context context) {
        setContentView(R.layout.diakog_connect_recorder_wifi);
        setCancelable(true);
        TextView okTv = (TextView) findViewById(R.id.tv_ok);
        okTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
                Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS);
//                intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                context.startActivity(intent);
            }
        });

    }

}
